<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="app" uri="http://www.wanrenhui.com" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	  <%@include file="/res/include/base-head.jsp"%>
	  <%@include file="/res/include/jquery-easyui.jsp"%>
	<script type="text/javascript" src="${pageContext.request.contextPath}/res/js/mall/supplier.js"></script>
  </head>
  <body>
	<div class="easyui-layout" data-options="fit:true">
		<div data-options="region:'north',border:false,split:false">
	    	<form id="query-form" class="search_form clearfix">
	            <dl>
					<dt>供应商名称：</dt>
					<dd>
						<input name="name" id="name" type="text" class="txt" maxlength="32"/>
					</dd>
				</dl>
				<dl>
					<dt>类型：</dt>
					<dd>
	                	<select name="type"  class="txt grid-10">
							<option value="">请选择</option>
							<option value="1">外部供应商</option>
							<option value="2">本地供应商</option>
						</select>
					</dd>
				</dl>
				<dl>
					<dt>状态：</dt>
					<dd>
	                	<select name="status"  class="txt grid-10">
							<option value="">请选择</option>
							<option value="1">正常</option>
							<option value="2">失效</option>
						</select>
					</dd>
				</dl>
	            <p class="search_form_btn">
	            	<input type="button" value="搜索" class="icon_serach" onclick="admin.supplier.query()" />
	            	<input type="button" value="新建" class="icon_serach" onclick="admin.supplier.toAdd()" />
	            </p>
	        </form>
	  	</div>
	    <div data-options="region:'center',border:false">
		    <table id="datagrid" data-options="url:'${pageContext.request.contextPath}/mall/supplier/list',toolbar:'#toolbar'">
				<thead>
					<tr>
						<th data-options="field:'name',width:200,align:'center'">名称</th>
						<th data-options="field:'type',width:80,align:'center',formatter:formatType">类型</th>
						<th data-options="field:'oidx',width:50,align:'center'">排序</th>
						<th data-options="field:'status',width:80,align:'center',formatter:formatStatus">状态</th>
						<th data-options="field:'resume',width:250,align:'center'">简介</th>
						<th data-options="field:'strNewAt',width:150,align:'center'">创建时间</th>
			            <th data-options="field:'id',align:'center',width:200,formatter:formatOperation">操作</th>
					</tr>
				</thead>
			</table>
	  	</div>
	</div>

	<script type="text/javascript">
	function formatType(value,row,index) {
		var l_html = '外部供应商';
		if (value==2) {
			l_html = '本地供应商';
		}
		return l_html;
	}
		function formatStatus(value,row,index) {
			var l_html = '有效';
			if (value==2) {
				l_html = '失效';
			}
			return l_html;
		}
		function formatOperation(value,row,index) {
			var l_html = '';
			l_html += '<a href="javascript:;" class="table_link"  onclick="admin.supplier.edit('+row.id+')">编辑</a>';
			return l_html;
		}
	</script>
  </body>
</html>
